]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Cope with a missing -arrow-border-color when we have no border
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 23 Jul 2012 02:02:31 +0000 (23:02 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 3 Aug 2012 17:26:24 +0000 (14:26 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=680426

js/ui/boxpointer.js

index c83c31e42044f0f641e93dd3e83ae2d5f1675b6a..03d114bac0a0c06ac24a56b1a229061741a1aee7 100644 (file)
@@ -252,7 +252,6 @@ const BoxPointer = new Lang.Class({
         let halfBorder = borderWidth / 2;
         let halfBase = Math.floor(base/2);
 
-        let borderColor = themeNode.get_color('-arrow-border-color');
         let backgroundColor = themeNode.get_color('-arrow-background-color');
 
         let [width, height] = area.get_surface_size();
@@ -263,7 +262,6 @@ const BoxPointer = new Lang.Class({
             boxWidth -= rise;
         }
         let cr = area.get_context();
-        Clutter.cairo_set_source_color(cr, borderColor);
 
         // Translate so that box goes from 0,0 to boxWidth,boxHeight,
         // with the arrow poking out of that
@@ -359,9 +357,13 @@ const BoxPointer = new Lang.Class({
 
         Clutter.cairo_set_source_color(cr, backgroundColor);
         cr.fillPreserve();
-        Clutter.cairo_set_source_color(cr, borderColor);
-        cr.setLineWidth(borderWidth);
-        cr.stroke();
+
+        if (borderWidth > 0) {
+            let borderColor = themeNode.get_color('-arrow-border-color');
+            Clutter.cairo_set_source_color(cr, borderColor);
+            cr.setLineWidth(borderWidth);
+            cr.stroke();
+        }
     },
 
     setPosition: function(sourceActor, alignment) {